y = ystart - (gate_step*sprite_height);
if ((gate_step < 1) && (trigger_get(gate_trigger) == true)) || ((gate_step > 0) && (trigger_get(gate_trigger) == false))
{
    switch (gate_counter)
    {
        case -1:
            gate_counter = room_speed;
        break;
        case 0:
            gate_step += (1/gate_step_total)*((((gate_step < 1) && (trigger_get(gate_trigger) == true))*2)-1);
        break;
    }
    gate_counter -= 1;
}
